package com.penghaonan.appframework.widget;

import android.content.Context;
import android.util.AttributeSet;
import android.widget.FrameLayout;

import androidx.annotation.Nullable;

import com.penghaonan.appframework.utils.Logger;
import com.penghaonan.appframework.utils.UIUtils;

public class StatusBarSpace extends FrameLayout {
    public StatusBarSpace(Context context) {
        super(context);
        init();
    }

    public StatusBarSpace(Context context, @Nullable AttributeSet attrs) {
        super(context, attrs);
        init();
    }

    public StatusBarSpace(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
        init();
    }

    private void init() {
        int statusBarHeight = UIUtils.getStatusBarHeight();
        Logger.i("statusBarHeight = " + statusBarHeight);
        setMinimumHeight(statusBarHeight);
    }

    @Override
    protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
        super.onLayout(changed, left, top, right, bottom);
        Logger.i("height = " + (bottom - top));
    }
}
